package com.ane.service.impl;

import com.ane.entity.CommonJsonVO;
import com.ane.entity.RtLineVO;
import com.ane.mapper.RtLineSqlMapMapper;
import com.ane.util.Page;
import com.ane.util.ResponseHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 李志强
 * @version 0.1
 * @time 2017/3/11 21:05
 * @since 0.1
 */
@Service
public class TestServiceImpl {
	@Autowired
	private RtLineSqlMapMapper rtLineSqlMapMapper;
	
	public String test (RtLineVO params) {
		Page page = new Page(params.getStart(), params.getLimit());
		params.setPage(page);
		List<RtLineVO> list = new ArrayList<RtLineVO>();
		list = rtLineSqlMapMapper.queryPagedList(params);
		return ResponseHelper.buildSuccessPageResp("", list, page);
	}
	public String test2 (RtLineVO params) {
		Page page = new Page(params.getStart(), params.getLimit());
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("page",page);
		map.put("startDate",params.getStartDate());
		map.put("endDate",params.getEndDate());
		List<RtLineVO> list = new ArrayList<RtLineVO>();
		list = rtLineSqlMapMapper.queryPagedList2(map);
		return ResponseHelper.buildSuccessPageResp("", list, page);
	}
}
